
<template>
  <div>
    <h1>Processing OAuth Callback</h1>
  </div>
</template>
<script setup>
import { reactive, ref, watch} from 'vue'
// 导入图标
import {User, Lock} from '@element-plus/icons-vue'
// 导入消息提示弹框
import { ElMessage } from 'element-plus'
// import request from '../api/index.js'
import { authToken } from '../api/authtoken.js'
import { CONFIG } from '../config/index.js'
import { useRouter } from 'vue-router'
// import { authToken } from '../api/authtoken.js'
// import JSEncrypt from 'jsencrypt';
const loginRef = ref()
const loginInfo = reactive({
     username: "",
     password: "",
})
async function getAuth0Token(loginType, loginName) {
    try {
        //if (loginType.value == "" || !loginName.value == "") {
        //    console.log("没有有效的登录信息，无法请求菜单数据");
        //    return [];
        //}
        // 假设 fetch 请求带上登录信息

        const response = await authToken(loginType.value,loginName.value)      
    } catch (error) {
        console.error("Error fetching menus:", error);
        throw error;  // 抛出错误
    }
}


onMounted (async()=>{
  const queryParams = new URLSearchParams(window.location.search);
  console.log("queryParams:=====================",queryParams)
  const response = await getAuth0Token(queryParams)
  const result =response.data.data
  window.location.href = "http://102.168.10.16:8080/oauth?access_token=" + result.AccessToken;
})



</script>

<style scoped>
</style>
